<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function myfn(){
		var i1 = document.getElementById("i1");
		var i2 = document.getElementById("i2");
		var u = document.getElementById("myul");
		//拆分
		var arr = i1.value.split(i2.vlue);
		//遍历数组
		for(var i=0;i<arr.length;i++){
			var str =arr[i];. 
			myul.innerHTML+="<li>"+str+"</li>";
		}
	}
</script>
</head>
<body>
<input type="text" id="i1">
<input type="text" id="i2">
<input type="button" value="添加" onclick="myfn()">
<ul id="myul"></ul>
</body>
</html>